<template>
    <div>
        <div class="title">请选择投诉原因</div>
        <ul class="reasonlist">
            <li v-for="(item,index) in list" @click="reasonform(item.content)">
                <div>{{item.content}}</div>
                <span></span>
            </li>
        </ul>
    </div>
</template>

<script>
    export default {
        name: "",
        data(){
            return {
                matertitle:"",
                materialsid:"",
                list:[]
            }
        },
        mounted(){
            this.materialsid=this.$route.params.id;
            this.matertitle=this.$route.query.matertitle;
            this.getList();
        },
        methods:{
            reasonform(txt){
                this.$router.push({
                    path:"/Wodeliao/complainform",
                    query:{
                        id:this.materialsid,
                        matertitle:this.matertitle,
                        reason:txt
                    }
                })
            },
            getList(){
                var that=this;
                that.request1.post1({
                    url: that.Url + "api/complaint/complaintReason",
                    params: { },
                    success: function (res) {
//                        console.log(res)
                        if (res.data.code == 1) {
                            that.list=res.data.data;
                        } else {
                            alert(res.data.msg)
                        }
                    },
                    fail: function (error) {
//                        alert(error.data.msg)
                    }
                })
            }
        }
    }
</script>

<style scoped>
    .title{
        height: 48px;
        line-height: 60px;
        padding: 0 12px;
        box-sizing: border-box;
        font-size: 14px;
        color: #999;
    }
    .reasonlist li{
        background: #fff;
        border-top: 1px solid #ececec;
        display: flex;
        flex-flow: row;
        justify-content: space-between;
        align-items: center;
        height: 42px;
        padding: 0 12px;
        box-sizing: border-box;
        font-size: 14px;
    }
    .reasonlist li span {
        width: 20px;
        height: 60px;
        float: right;
        right: 15px;
        background: url() 100% no-repeat;
        background-size: 6px;
    }
</style>